import { RouteRecordRaw } from 'vue-router';
export const Layout = () => import('@/layout/index.vue');

// ["article", "user", "Manage-users", "add-article", "roles", "Manage"]
export const asyncRoutes: RouteRecordRaw[] = [
  {
		path: '/article',
		component: 'Layout',
		redirect: '/article/list',
		meta: { title: '文章板块', icon: 'order', affix: true,  roles: [ 'add-article', 'min-article'] },
		children: [
			{
				path: '/article/add-article',
				name: 'add-article',
				component: 'article/add-article',
				meta: { title: '新增文章', icon: 'skill', affix: true, roles: ['add-article'] },
			},
			{
				path: '/article/list',
				name: 'article',
				component: 'article/article',
				meta: { title: '文章列表', icon: 'nested', affix: true, roles: ['min-article'] },
			}
		],
	},
  {
    path: '/user',
		component: 'Layout',
		redirect: '/user/list',
		meta: { title: '用户板块', roles: ['Manage-users', 'role', 'Manage'] },
    children: [
      {
				path: '/user/list',
				name: 'user-list',
				component: 'user/index',
				meta: { title: '用户管理', roles: ['Manage'] },
			},
      {
				path: '/user/admin',
				name: 'user-admin',
				component: 'user/admin-user',
				meta: { title: '角色管理', roles: ['role'] },
			}
    ]
  }
]
